package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;

import java.util.Date;
import java.util.List;


@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(resultMap = "com.ruoyi.factorydata.mapper.MaterialRequisitionMapper.MaterialRequisitionResult")
public class MaterialRequisition extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 领料单号
     */
    @Excel(name = "领料单号")
    private String requisitionNo;

    /**
     * 项目ID
     */
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 计划ID
     */
    @Excel(name = "计划ID")
    private Long planId;

    /**
     * 工单ID
     */
    @Excel(name = "工单ID")
    private Long workOrderId;

    @Excel(name = "工单编号")
    @TableField(exist = false)
    private String workOrderCode;

    /**
     * 领料类型(1-生产领料,2-追加领料)
     */
    @Excel(name = "领料类型(1-生产领料,2-追加领料)")
    private Integer requisitionType;

    /**
     * 领料人ID
     */
    @Excel(name = "领料人ID")
    private Long requisitionUserId;

    @Excel(name = "领料人")
    @TableField(exist = false)
    private String requisitionUserName;

    /**
     * 领料数量
     */
    @Excel(name = "领料数量")
    @TableField(exist = false)
    private Long requisitionQuantity;

    /**
     * 领料时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "领料时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date requisitionTime;

    /**
     * 领料状态(-1-已拒绝 0-待审批,2-已审批,3-已完成)
     */
    @Excel(name = "领料状态(-1-已拒绝 0-待审批,2-已审批,3-已完成)")
    private Integer status;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Integer version;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    @TableField(exist = false)
    private String updateByName;

    /**
     * 领料单详情
     */
    @TableField(exist = false)
    private List<MaterialRequisitionDetail> materialRequisitionDetailList;


    @TableField(exist = false)
    private Integer isFinish;
}